﻿using System;
using System.Web;
using System.Web.Services;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;

using SBPweb.Services.Base;
using SBPweb.Services.Crawlers.Base;

namespace SBPweb.Services.Crawlers.PortHu
{

    [WebService(
        Name = "SBPweb Crawler service - PortHu",
        Namespace = "http://services.sbpweb.hu/crawlers/PortHu",
        Description = "services.sbpweb.hu/crawlers/PortHu")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class Service : ServiceBase
    {

        #region Private fields

        private Uri pBaseUri;

        #endregion

        #region Constructor logic

        public Service()
        {
            pBaseUri = new Uri(Properties.Settings.Default.BaseUri);
        }

        public Service(Uri baseUri)
        {
            pBaseUri = baseUri;
        }

        #endregion

        #region Methods

        [WebMethod(true)]
        public SBPweb.Services.Crawlers.Movies.Movies.TitleRow RequestTitleById(string titleId)
        {

            Uri uri = new Uri(string.Format("{0}pls/fi/films.film_page?i_film_id={1}", pBaseUri, titleId));
            Client client = new Client(uri);
            string content = client.ParseRequest(uri);
            return null;
        }


        #endregion

    }

}